<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <style type="text/css">
      body,html,#container{
        height: 100%;
        margin: 0px;
        font: 12px Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial;
      }
    </style>
	<title>武侯祠</title>
	<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
	<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
	<div id="container" tabindex="0"></div>
	<div id="panel"></div>
	<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=e843bab8ae313a72cea9ed68ef713efd"></script> 
	<script type="text/javascript">
	var marker,map = new AMap.Map('container',{
		resizeEnable:true,
		zoom:18,
		center:[104.048022,30.646217]
	});
	var lng;
	var lat;
	

	map.on('click',function(e){
		lng = e.lnglat.getLng();
		lat = e.lnglat.getLat();
		addMarker(); 
	}
	
	);
	
	function addMarker() {
        marker = new AMap.Marker({
            icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
            position: [lng, lat],
           /* draggable:true,        //保留拖动功能
            cursor:'move',
            raiseOnDrag:true */
        });
        marker.setMap(map);
    }
	</script>
</body>
</html>